package cn.example.progression;

import android.os.Parcel;
import android.os.Parcelable;

public class Person2 implements Parcelable {

    private String name;
    private int age;

    protected Person2(Parcel in) {
        name = in.readString();
        age = in.readInt();
    }

    public static final Creator<Person2> CREATOR = new Creator<Person2>() {
        @Override
        public Person2 createFromParcel(Parcel in) {
            return new Person2(in);
        }

        @Override
        public Person2[] newArray(int size) {
            return new Person2[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(name);
        parcel.writeInt(age);
    }


}
